<template>
    <van-empty description="当前页面不存在, 抱歉">
      <!-- router-link -->
      <!-- <RouterLink custom v-slot="{ navigate }" :to="{ name: 'home' }">
        <van-button @click="navigate" round type="primary" class="bottom-button">回到首页</van-button>
      </RouterLink> -->
      <!-- 编程式导航 -->
      <van-button @click="backToHome" round type="primary" class="bottom-button">回到首页</van-button>
    </van-empty>
  </template>
  <script setup lang="ts">
  // vue-router 提供了useRouter/useRoute/useLink三个组合式函数
  import { useRouter } from 'vue-router'
  const router = useRouter()
  
  const backToHome = () => {
    router.push({ name: 'home' })
  }
  </script>
  